<!DOCTYPE html>
<html>
<head>
	<meta charset="utf-8" />
	<link rel="stylesheet" href="css/safe.css" />
	<link rel="stylesheet" href="css/form.css" />
	
</head>

<body>
	<div id="header-wrap" data-mn=0 data-begin=1>
		<a href="###" data-link="account" data-type="ico" class="left ico-m ico-left"></a>
		<h2>安全中心</h2>
	</div>
	<div class="rop-wrap">
		<h3>账户安全等级</h3>
		<div class="rop" id="rop">
			<div class="lv-line">
				<div class="lv-line-c"></div>
				<div class="ruler"></div>
			</div>
		</div>
	</div>
	<ul class="form-list">
		<li data-type="ico" class="ico-m ico-pl ico-mobile">
			<div class="fl-cont form-sel">
				<a href="###" data-link="edit-mobile" data-type="ico" class="ico-m ico-pr ico-right">手机号<em id="set-mob">136****2168</em></a>
			</div>
		</li>
		<li data-type="ico" class="ico-m ico-pl ico-mail">
			<div class="fl-cont form-sel">
				<a href="###" data-link="edit-mail" data-type="ico" class="ico-m ico-pr ico-right">邮箱<em id="set-mail"></em></a>
			</div>
		</li>
		<li data-type="ico" class="ico-m ico-pl ico-lock">
			<div class="fl-cont form-sel">
				<a href="###" data-link="edit-pw" data-type="ico" class="ico-m ico-pr ico-right">登录密码<em id="set-pw">修改</em></a>
			</div>
		</li>
		<li data-type="ico" class="ico-m ico-pl ico-lock-2">
			<div class="fl-cont form-sel">
				<a href="###" data-link="edit-tpw" data-type="ico" class="ico-m ico-pr ico-right">资金密码<em id="set-tpw"></em></a>
			</div>
		</li>
		<li data-type="ico" class="ico-m ico-pl ico-card">
			<div class="fl-cont form-sel">
				<a href="###" data-link="edit-bcard" data-type="ico" class="ico-m ico-pr ico-right">银行卡<em id="set-bcard"></em></a>
			</div>
		</li>
		<li data-type="ico" class="ico-m ico-pl ico-id">
			<div class="fl-cont form-sel">
				<a href="###" data-link="edit-id" data-type="ico" class="ico-m ico-pr ico-right">实名认证<em id="set-id"></em></a>
			</div>
		</li>
		<li data-type="ico" class="ico-m ico-pl ico-user-s ">
			<div class="fl-cont form-sel">
				<a href="###" data-link="edit-nick" data-type="ico" class="ico-m ico-pr ico-right">昵称<em id="set-nick"></em></a>
			</div>
		</li>
	</ul>
	<a href="###" class="btn b-blue" id="quit">安全退出</a>
	<a href="###" class="btn b-gray b-small" id="clear">清空demo数据</a>
	<script>
	$(function(){
		var safe_rate = 0;
		var mobile = $.cookie("mobile");
		var mail = $.cookie("mail_show");
		var pw = $.cookie("user_pw");
		var tpw = $.cookie("tpw");
		var bcard = $.cookie("bc_show_2");
		var id = $.cookie("id_code");
		var name = $.cookie("name_show");
		var nick = $.cookie("nick");
		if(mobile !== undefined){
			var mob = $.cookie("mobile")
			$("#set-mob").html(mob)
			safe_rate  += 2;
		};
		if(pw !== undefined){
			$("#set-pw").html("修改")
			safe_rate  += 1;
		};
		if(mail !== undefined){
			$("#set-mail").html(mail);
			safe_rate  += 1;
		}else{
			$("#set-mail").html("<i style='color:#e73335'>未绑定</i>")
		};
		if(tpw !== undefined){
			$("#set-tpw").html("修改");
			safe_rate  += 5;
		}else{
			$("#set-tpw").html("<i style='color:#e73335'>未设置</i>")
		};
		if(bcard !== undefined){
			$("#set-bcard").html(bcard);
			safe_rate  += 5;
		}else{
			$("#set-bcard").html("<i style='color:#e73335'>未绑定</i>")
		};
		if(name !== undefined){
			var name_show = $.cookie("name_show")
			$("#set-id").html(name_show)
			safe_rate  += 5;
		}else{
			$("#set-id").html("<i style='color:#e73335'>未认证</i>")
		};
		
		if(nick !== undefined){
			$("#set-nick").html(nick)
			safe_rate  += 1;
		}else{
			$("#set-nick").html("<i style='color:#e73335'>未设置</i>")
		}
		$("#rop").rop({rate:safe_rate})
		$("#quit").on("click",function(){
			$.cookie("begin","",{expires: -1})
			$.cookie("login","",{expires: -1})
			$.cookie("page_c","",{expires: -1})
			$.cookie("page_p","",{expires: -1})
			load_page("login")
		})
		$("#clear").on("click",function(){
			var clear = confirm("要清空数据吗？\n清空后您需要重新注册，并设置安全信息！");
			if (clear == true){
				$.cookie("begin","",{expires: -1})
				$.cookie("login","",{expires: -1})
				$.cookie("id","",{expires: -1})
				$.cookie("mobile","",{expires: -1})
				$.cookie("name","",{expires: -1})
				$.cookie("page_c","",{expires: -1})
				$.cookie("page_p","",{expires: -1})
				$.cookie("user_id","",{expires: -1})
				$.cookie("user_pw","",{expires: -1})
				$.cookie("id_code","",{expires: -1})
				$.cookie("id_temp","",{expires: -1})
				
				load_page("start")
			}else{
				return false
			}
		})
		
	})
	</script>
</body>

</html>
